package BehavioralMode.iterator.StudentDemo;

import java.util.List;

public class ConcreteIterator implements AbstractIterator{

    private List<Student> list;
    private int position = 0;


    public ConcreteIterator(List<Student> list) {
        this.list = list;
    }

    @Override
    public Boolean hasNext() {
        if(position > list.size() - 1) return false;
        return true;
    }

    @Override
    public Student getCurrentEle() {
        return list.get(position++);
    }
}
